package cn.com.hhrcw.web;


import cn.com.hhrcw.service.SyncService;
import cn.com.hhrcw.vo.SyncDataVO;
import org.jeecg.common.api.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin/api")
public class AdminApiController {

    @Autowired
    private SyncService syncService;

    @GetMapping(value = "/sync/resume/{syncDate}")
    public Result syncResume(@PathVariable(value="syncDate") String syncDate){
        //syncDate  yyyyMMdd格式
        try{
            String json = syncService.getSyncData(syncDate);
            return Result.ok(json);
        }
        catch (Exception e){
            return Result.error(e.getMessage());
        }

    }
}
